package com.hgf.helper.mybatisplusdemo.helper;

import com.hgf.helper.mybatisplusdemo.db.entity.Student;
import com.hgf.helper.mybatisplusdemo.db.service.StudentServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Component
public class WebHelper {

    @Autowired
    StudentServiceImpl studentService;

    @Autowired
    Web2Helper web2Helper;

    @Transactional(rollbackFor = Exception.class)
    public void testTra() {

        studentService.updateTargetFieldById(Student::getBirthday, new Date(), 2);

        web2Helper.b();

        studentService.updateTargetFieldById(Student::getBirthday, new Date(), 23);

    }

}
